//Original:/testcases/core/c_dsp32shift_pack/c_dsp32shift_pack.dsp
// Spec Reference: dsp32shift pack
# mach: bfin

.include "testutils.inc"
	start



imm32 r0, 0x01230000;
imm32 r1, 0x02345678;
imm32 r2, 0x03456789;
imm32 r3, 0x0456789a;
imm32 r4, 0x056789ab;
imm32 r5, 0x06789abc;
imm32 r6, 0x0789abcd;
imm32 r7, 0x089abcde;
R1 = PACK( R0.L , R0.L );
R2 = PACK( R1.L , R0.H );
R3 = PACK( R2.H , R0.L );
R4 = PACK( R3.H , R0.H );
R5 = PACK( R4.L , R0.L );
R6 = PACK( R5.L , R0.H );
R7 = PACK( R6.H , R0.L );
R0 = PACK( R7.H , R0.H );
CHECKREG r1, 0x00000000;
CHECKREG r0, 0x00000123;
CHECKREG r2, 0x00000123;
CHECKREG r3, 0x00000000;
CHECKREG r4, 0x00000123;
CHECKREG r5, 0x01230000;
CHECKREG r6, 0x00000123;
CHECKREG r7, 0x00000000;

imm32 r0, 0x11230001;
imm32 r1, 0x12345678;
imm32 r2, 0x1bcdef12;
imm32 r3, 0x1456789a;
imm32 r4, 0x1cdef012;
imm32 r5, 0x1456789a;
imm32 r6, 0x1789abcd;
imm32 r7, 0x189abcde;
R2 = PACK( R0.L , R1.L );
R3 = PACK( R1.L , R1.H );
R4 = PACK( R2.H , R1.L );
R5 = PACK( R3.H , R1.H );
R6 = PACK( R4.L , R1.L );
R7 = PACK( R5.L , R1.H );
R0 = PACK( R6.H , R1.L );
R1 = PACK( R7.H , R1.H );
CHECKREG r0, 0x56785678;
CHECKREG r1, 0x12341234;
CHECKREG r2, 0x00015678;
CHECKREG r3, 0x56781234;
CHECKREG r4, 0x00015678;
CHECKREG r5, 0x56781234;
CHECKREG r6, 0x56785678;
CHECKREG r7, 0x12341234;

imm32 r0, 0x20230002;
imm32 r1, 0x21345678;
imm32 r2, 0x22456789;
imm32 r3, 0x2356789a;
imm32 r4, 0x246789ab;
imm32 r5, 0x25789abc;
imm32 r6, 0x2689abcd;
imm32 r7, 0x279abcde;
R3 = PACK( R0.L , R2.L );
R4 = PACK( R1.L , R2.H );
R5 = PACK( R2.H , R2.L );
R6 = PACK( R3.H , R2.H );
R7 = PACK( R4.L , R2.L );
R0 = PACK( R5.L , R2.H );
R1 = PACK( R6.H , R2.L );
R2 = PACK( R7.H , R2.H );
CHECKREG r0, 0x67892245;
CHECKREG r1, 0x00026789;
CHECKREG r2, 0x22452245;
CHECKREG r3, 0x00026789;
CHECKREG r4, 0x56782245;
CHECKREG r5, 0x22456789;
CHECKREG r6, 0x00022245;
CHECKREG r7, 0x22456789;

imm32 r0, 0x31230003;
imm32 r1, 0x31345678;
imm32 r2, 0x31456789;
imm32 r3, 0x3156789a;
imm32 r4, 0x316789ab;
imm32 r5, 0x31789abc;
imm32 r6, 0x3189abcd;
imm32 r7, 0x311abcde;
R4 = PACK( R0.L , R3.L );
R5 = PACK( R1.L , R3.H );
R6 = PACK( R2.H , R3.L );
R7 = PACK( R3.H , R3.H );
R0 = PACK( R4.L , R3.L );
R1 = PACK( R5.L , R3.H );
R2 = PACK( R6.H , R3.L );
R3 = PACK( R7.H , R3.H );
CHECKREG r0, 0x789A789A;
CHECKREG r1, 0x31563156;
CHECKREG r2, 0x3145789A;
CHECKREG r3, 0x31563156;
CHECKREG r4, 0x0003789A;
CHECKREG r5, 0x56783156;
CHECKREG r6, 0x3145789A;
CHECKREG r7, 0x31563156;

imm32 r0, 0x41230004;
imm32 r1, 0x42345678;
imm32 r2, 0x43456789;
imm32 r3, 0x4456789a;
imm32 r4, 0x456789ab;
imm32 r5, 0x46789abc;
imm32 r6, 0x4789abcd;
imm32 r7, 0x489abcde;
R0 = PACK( R0.L , R4.L );
R1 = PACK( R1.L , R4.H );
R2 = PACK( R2.H , R4.L );
R3 = PACK( R3.H , R4.H );
R4 = PACK( R4.L , R4.L );
R5 = PACK( R5.L , R4.H );
R6 = PACK( R6.H , R4.L );
R7 = PACK( R7.H , R4.H );
CHECKREG r0, 0x000489AB;
CHECKREG r1, 0x56784567;
CHECKREG r2, 0x434589AB;
CHECKREG r3, 0x44564567;
CHECKREG r4, 0x89AB89AB;
CHECKREG r5, 0x9ABC89AB;
CHECKREG r6, 0x478989AB;
CHECKREG r7, 0x489A89AB;

imm32 r0, 0x51230005;
imm32 r1, 0x52345678;
imm32 r2, 0x53456789;
imm32 r3, 0x5456789a;
imm32 r4, 0x556789ab;
imm32 r5, 0x56789abc;
imm32 r6, 0x5789abcd;
imm32 r7, 0x589abcde;
R6 = PACK( R0.L , R5.L );
R7 = PACK( R1.L , R5.H );
R0 = PACK( R2.H , R5.L );
R1 = PACK( R3.H , R5.H );
R2 = PACK( R4.L , R5.L );
R3 = PACK( R5.L , R5.H );
R4 = PACK( R6.H , R5.L );
R5 = PACK( R7.H , R5.H );
CHECKREG r0, 0x53459ABC;
CHECKREG r1, 0x54565678;
CHECKREG r2, 0x89AB9ABC;
CHECKREG r3, 0x9ABC5678;
CHECKREG r4, 0x00059ABC;
CHECKREG r5, 0x56785678;
CHECKREG r6, 0x00059ABC;
CHECKREG r7, 0x56785678;

imm32 r0, 0x61230006;
imm32 r1, 0x62345678;
imm32 r2, 0x63456789;
imm32 r3, 0x6456789a;
imm32 r4, 0x656789ab;
imm32 r5, 0x66789abc;
imm32 r6, 0x6789abcd;
imm32 r7, 0x689abcde;
R7 = PACK( R0.L , R6.L );
R0 = PACK( R1.L , R6.H );
R1 = PACK( R2.H , R6.L );
R2 = PACK( R3.H , R6.H );
R3 = PACK( R4.L , R6.L );
R4 = PACK( R5.L , R6.H );
R5 = PACK( R6.H , R6.L );
R6 = PACK( R7.H , R6.H );
CHECKREG r0, 0x56786789;
CHECKREG r1, 0x6345ABCD;
CHECKREG r2, 0x64566789;
CHECKREG r3, 0x89ABABCD;
CHECKREG r4, 0x9ABC6789;
CHECKREG r5, 0x6789ABCD;
CHECKREG r6, 0x00066789;
CHECKREG r7, 0x0006ABCD;

imm32 r0, 0x71230007;
imm32 r1, 0x72345678;
imm32 r2, 0x73456789;
imm32 r3, 0x7456789a;
imm32 r4, 0x756789ab;
imm32 r5, 0x76789abc;
imm32 r6, 0x7789abcd;
imm32 r7, 0x789abcde;
R0 = PACK( R0.L , R7.L );
R1 = PACK( R1.L , R7.H );
R2 = PACK( R2.H , R7.L );
R3 = PACK( R3.H , R7.H );
R4 = PACK( R4.L , R7.L );
R5 = PACK( R5.L , R7.H );
R6 = PACK( R6.H , R7.L );
R7 = PACK( R7.H , R7.H );
CHECKREG r0, 0x0007BCDE;
CHECKREG r1, 0x5678789A;
CHECKREG r2, 0x7345BCDE;
CHECKREG r3, 0x7456789A;
CHECKREG r4, 0x89ABBCDE;
CHECKREG r5, 0x9ABC789A;
CHECKREG r6, 0x7789BCDE;
CHECKREG r7, 0x789A789A;

imm32 r0, 0x81230008;
imm32 r1, 0x82345678;
imm32 r2, 0x83456789;
imm32 r3, 0x8456789a;
imm32 r4, 0x856789ab;
imm32 r5, 0x86789abc;
imm32 r6, 0x8789abcd;
imm32 r7, 0x889abcde;
R0 = PACK( R0.L , R0.L );
R1 = PACK( R1.L , R0.H );
R2 = PACK( R2.H , R0.L );
R3 = PACK( R3.H , R0.H );
R4 = PACK( R4.L , R0.L );
R5 = PACK( R5.L , R0.H );
R6 = PACK( R6.H , R0.L );
R7 = PACK( R7.H , R0.H );
CHECKREG r0, 0x00080008;
CHECKREG r1, 0x56780008;
CHECKREG r2, 0x83450008;
CHECKREG r3, 0x84560008;
CHECKREG r4, 0x89AB0008;
CHECKREG r5, 0x9ABC0008;
CHECKREG r6, 0x87890008;
CHECKREG r7, 0x889A0008;

imm32 r0, 0x91230009;
imm32 r1, 0x92345678;
imm32 r2, 0x93456789;
imm32 r3, 0x9456789a;
imm32 r4, 0x956789ab;
imm32 r5, 0x96789abc;
imm32 r6, 0x9789abcd;
imm32 r7, 0x989abcde;
R0 = PACK( R0.L , R1.L );
R1 = PACK( R1.L , R1.H );
R2 = PACK( R2.H , R1.L );
R3 = PACK( R3.H , R1.H );
R4 = PACK( R4.L , R1.L );
R5 = PACK( R5.L , R1.H );
R6 = PACK( R6.H , R1.L );
R7 = PACK( R7.H , R1.H );
CHECKREG r0, 0x00095678;
CHECKREG r1, 0x56789234;
CHECKREG r2, 0x93459234;
CHECKREG r3, 0x94565678;
CHECKREG r4, 0x89AB9234;
CHECKREG r5, 0x9ABC5678;
CHECKREG r6, 0x97899234;
CHECKREG r7, 0x989A5678;


imm32 r0, 0xa123000a;
imm32 r1, 0xa2345678;
imm32 r2, 0xa3456789;
imm32 r3, 0xa456789a;
imm32 r4, 0xa56789ab;
imm32 r5, 0xa6789abc;
imm32 r6, 0xa789abcd;
imm32 r7, 0xa89abcde;
R0 = PACK( R0.L , R2.L );
R1 = PACK( R1.L , R2.H );
R2 = PACK( R2.H , R2.L );
R3 = PACK( R3.H , R2.H );
R4 = PACK( R4.L , R2.L );
R5 = PACK( R5.L , R2.H );
R6 = PACK( R6.H , R2.L );
R7 = PACK( R7.H , R2.H );
CHECKREG r0, 0x000A6789;
CHECKREG r1, 0x5678A345;
CHECKREG r2, 0xA3456789;
CHECKREG r3, 0xA456A345;
CHECKREG r4, 0x89AB6789;
CHECKREG r5, 0x9ABCA345;
CHECKREG r6, 0xA7896789;
CHECKREG r7, 0xA89AA345;

imm32 r0, 0xb123000b;
imm32 r1, 0xb2345678;
imm32 r2, 0xb3456789;
imm32 r3, 0xb456789a;
imm32 r4, 0xb56789ab;
imm32 r5, 0xb6789abc;
imm32 r6, 0xb789abcd;
imm32 r7, 0xb89abcde;
R0 = PACK( R0.L , R3.L );
R1 = PACK( R1.L , R3.H );
R2 = PACK( R2.H , R3.L );
R3 = PACK( R3.H , R3.H );
R4 = PACK( R4.L , R3.L );
R5 = PACK( R5.L , R3.H );
R6 = PACK( R6.H , R3.L );
R7 = PACK( R7.H , R3.H );
CHECKREG r0, 0x000B789A;
CHECKREG r1, 0x5678B456;
CHECKREG r2, 0xB345789A;
CHECKREG r3, 0xB456B456;
CHECKREG r4, 0x89ABB456;
CHECKREG r5, 0x9ABCB456;
CHECKREG r6, 0xB789B456;
CHECKREG r7, 0xB89AB456;

imm32 r0, 0xc123000c;
imm32 r1, 0xc2345678;
imm32 r2, 0xc3456789;
imm32 r3, 0xc456789a;
imm32 r4, 0xc56789ab;
imm32 r5, 0xc6789abc;
imm32 r6, 0xc789abcd;
imm32 r7, 0xc89abcde;
R0 = PACK( R0.L , R4.L );
R1 = PACK( R1.L , R4.H );
R2 = PACK( R2.H , R4.L );
R3 = PACK( R3.H , R4.H );
R4 = PACK( R4.L , R4.L );
R5 = PACK( R5.L , R4.H );
R6 = PACK( R6.H , R4.L );
R7 = PACK( R7.H , R4.H );
CHECKREG r0, 0x000C89AB;
CHECKREG r1, 0x5678C567;
CHECKREG r2, 0xC34589AB;
CHECKREG r3, 0xC456C567;
CHECKREG r4, 0x89AB89AB;
CHECKREG r5, 0x9ABC89AB;
CHECKREG r6, 0xC78989AB;
CHECKREG r7, 0xC89A89AB;

imm32 r0, 0xd123000d;
imm32 r1, 0xd2345678;
imm32 r2, 0xd3456789;
imm32 r3, 0xd456789a;
imm32 r4, 0xd56789ab;
imm32 r5, 0xd6789abc;
imm32 r6, 0xd789abcd;
imm32 r7, 0xd89abcde;
R0 = PACK( R0.L , R5.L );
R1 = PACK( R1.L , R5.H );
R2 = PACK( R2.H , R5.L );
R3 = PACK( R3.H , R5.H );
R4 = PACK( R4.L , R5.L );
R5 = PACK( R5.L , R5.H );
R6 = PACK( R6.H , R5.L );
R7 = PACK( R7.H , R5.H );
CHECKREG r0, 0x000D9ABC;
CHECKREG r1, 0x5678D678;
CHECKREG r2, 0xD3459ABC;
CHECKREG r3, 0xD456D678;
CHECKREG r4, 0x89AB9ABC;
CHECKREG r5, 0x9ABCD678;
CHECKREG r6, 0xD789D678;
CHECKREG r7, 0xD89A9ABC;


imm32 r0, 0xe123000e;
imm32 r1, 0xe2345678;
imm32 r2, 0xe3456789;
imm32 r3, 0xe456789a;
imm32 r4, 0xe56789ab;
imm32 r5, 0xe6789abc;
imm32 r6, 0xe789abcd;
imm32 r7, 0xe89abcde;
R0 = PACK( R0.L , R6.L );
R1 = PACK( R1.L , R6.H );
R2 = PACK( R2.H , R6.L );
R3 = PACK( R3.H , R6.H );
R4 = PACK( R4.L , R6.L );
R5 = PACK( R5.L , R6.H );
R6 = PACK( R6.H , R6.L );
R7 = PACK( R7.H , R6.H );
CHECKREG r0, 0x000EABCD;
CHECKREG r1, 0x5678E789;
CHECKREG r2, 0xE345ABCD;
CHECKREG r3, 0xE456E789;
CHECKREG r4, 0x89ABABCD;
CHECKREG r5, 0x9ABCE789;
CHECKREG r6, 0xE789ABCD;
CHECKREG r7, 0xE89AE789;

imm32 r0, 0xf123000f;
imm32 r1, 0xf2345678;
imm32 r2, 0xf3456789;
imm32 r3, 0xf456789a;
imm32 r4, 0xf56789ab;
imm32 r5, 0xf6789abc;
imm32 r6, 0xf789abcd;
imm32 r7, 0xf89abcde;
R0 = PACK( R0.L , R7.L );
R1 = PACK( R1.L , R7.H );
R2 = PACK( R2.H , R7.L );
R3 = PACK( R3.H , R7.H );
R4 = PACK( R4.L , R7.L );
R5 = PACK( R5.L , R7.H );
R6 = PACK( R6.H , R7.L );
R7 = PACK( R7.H , R7.H );
CHECKREG r0, 0x000FBCDE;
CHECKREG r1, 0x5678F89A;
CHECKREG r2, 0xF345BCDE;
CHECKREG r3, 0xF456F89A;
CHECKREG r4, 0x89ABBCDE;
CHECKREG r5, 0x9ABCF89A;
CHECKREG r6, 0xF789BCDE;
CHECKREG r7, 0xF89AF89A;
pass
